home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / U-Z / VideoToolBox Folder / VideoToolboxSources / CardSlot.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-22  |  692 b   |  30 lines  |  [TEXT/KAHL]

  1. /* CardSlot.c
  2. Finds the first NuBus slot that contains a card of the given name.
  3. Returns -1 if there's no such card.
  4. © Copyright (c) 1990 Denis G. Pelli
  5. HISTORY:
  6. 8/24/91    dgp    Made compatible with THINK C 5.0.
  7. 11/23/92 dgp dropped obsolete support for THINK C 4.
  8. */
  9. #include "VideoToolBox.h"
  10.  
  11. OSErr CardSlot(char *cardName)
  12. {
  13.     SpBlock mySpBlock;
  14.     OSErr error;
  15.     int slot;
  16.     unsigned char name[128];
  17.     
  18.     for(slot=9;slot<16;slot++){
  19.         mySpBlock.spSlot=slot;
  20.         error=SCkCardStat(&mySpBlock);
  21.         if(!error){
  22.             mySpBlock.spID=1;
  23.             mySpBlock.spResult=(long) &name;
  24.             error=SReadDrvrName(&mySpBlock);
  25.             if(!error && !strcmp(cardName,PtoCstr(name)))return slot;
  26.         }
  27.     }
  28.     return -1;    /* no such card */
  29. }
  30.